<?php 
namespace app\admin\model;
use think\Model;

class Evaluate extends Model
{
	public function tot()
	{
		return $this->select()->count();
	}
	public function show()
	{
		return $this->alias('e')
		            ->field('e.eid,e.oname,e.ophone,e.is_eva,t.tname,t.newprice,t.cc,t.emst,t.transmission,a.name')
		            ->join('cartype t','e.tid=t.tid')
		            ->join('area a','e.aid=a.id')
		            ->order('e.eid','desc');
	}
	public function updo($id,$mem)
	{
		return $this->where('eid',$id)->update(['is_eva'=>$mem]);
	}
	public function del($id)
	{
		return $this->where('eid',$id)->delete();
	}
}